import request from '@/utils/request'

export function addPreferential(data) {
  return request({
    url: '/juanbusiness/preferential-rules/add',
    method: 'post',
    data
  })
}

export function findPreferential(page, size, enable, preferentialType, rulesNumber) {
  return request({
    url: '/juanbusiness/preferential-rules/findPage',
    method: 'get',
    params: { page: page, size: size, enable: enable, preferentialType: preferentialType, rulesNumber: rulesNumber }
  })
}

export function getPreferential(data) {
  return request({
    url: '/juanbusiness/preferential-rules/get',
    method: 'get',
    data
  })
}

export function editPreferential(data) {
  return request({
    url: '/juanbusiness/preferential-rules/edit',
    method: 'put',
    data
  })
}

export function enablePreferential(data) {
  return request({
    url: '/juanbusiness/preferential-rules/enable',
    method: 'put',
    data
  })
}

export function delPreferential(id) {
  return request({
    url: '/juanbusiness/preferential-rules/del',
    method: 'delete',
    params: {id: id}
  })
}
